package Stack;

import Array.Array;

/**
 * @Description TODO
 * @Author zrj
 * @Date 2020/8/1 11:01
 * @Version 1.0
 */
public class ArraySatck implements Stack{

    Array array;

    public ArraySatck(int capacity) {
        array = new Array(capacity);
    }

    public ArraySatck() {
        array = new Array();
    }

    public int getSize() {
        return array.getSize();
    }

    public boolean isEmpty() {
        return array.isEmpty();
    }

    public void push(int e) {
        array.addLast(e);
    }

    public int pop() {
        return array.removeLast();
    }

    public int peek() {
        return array.getLast();
    }
}
